package com.oss.util;

import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

/**
 * 时间工具类
 * @author chengqiang
 */
@Component
public class TimeUtil {
    //token存活时长单位小时
    private final int tokenKeepAliveHour = 12;
    /**
     * 获取过期时间
     * 当前时间+12个小时
     * @return 返回过期时间
     */
    public LocalDateTime getExpirationTime(){
        return LocalDateTime.now().minusHours(-(Math.abs(tokenKeepAliveHour)));
    }
}
